<?php
system("logger -t sinapsis en ic pass " . $_SESSION['sess_login_userid']);

error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
require('./roots.php');
require($root_path.'include/inc_environment_global.php');
/**
* CARE2X Integrated Hospital Information System beta 2.0.1 - 2004-07-04
* GNU General Public License
* Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
* elpidio@care2x.org, 
*
* See the file "copy_notice.txt" for the licence notice
*/
$lang_tables=array('interconsulta.php');
define('LANG_FILE','stdpass.php');
define('NO_2LEVEL_CHK',1);
require_once($root_path.'include/inc_front_chain_lang.php');

require_once($root_path.'global_conf/areas_allow.php');

$target = $_GET['target'];
$id = $_GET['id'];
$res = $_GET['res'];


$append=URL_REDIRECT_APPEND;
//var_dump($id);
switch($target){
    case 'reg':
        $fileforward='interconsulta-registrar.php'.$append;
        $allowedarea=&$allow_area['medicoICtante'];
        break;
    case 'resp':
       	$fileforward='interconsulta-responder.php'.$append.'&id='.$id.'&res='.$res;
        $allowedarea=&$allow_area['medicoICtado'];
        break;
    case 'modif':
        $fileforward='interconsulta-modificar.php'.$append;
        $allowedarea=&$allow_area['medicoICtante'];
        break;
    case 'asig':
        $fileforward='interconsulta-asignar.php'.$append;
        $allowedarea=&$allow_area['triaje'];
        break;
    case 'asigsave':
        $fileforward='interconsulta-asignar-save.php'.$append.'&id='.$id.'&esp='.$esp;
        $allowedarea=&$allow_area['triaje'];
        break;
    case 'usutriaje':
        $fileforward='interconsulta-usutriaje.php'.$append;
        $allowedarea=&$allow_area['interadmin'];
        break;
    case 'espeusuario':
        $fileforward='interconsulta-espeusuario.php'.$append;
        $allowedarea=&$allow_area['triaje'];
        break;
    case 'buscar':
        $fileforward='interconsulta-buscar.php'.$append;
        $allowedarea=&$allow_area['triaje'];
        break;
    case 'todos':
        $fileforward='interconsulta-mias.php'.$append;
        $allowedarea=&$allow_area['medicoIC'];
        break;
}


$thisfile=basename(__FILE__);
$breakfile='interconsulta.php'.URL_APPEND.'&pid='.$pid;

// $userck='interconsulta_user';
// 
// setcookie($userck.$sid,'');
// require($root_path.'include/inc_2level_reset.php'); 
// setcookie(ck_2level_sid.$sid,'');

require($root_path.'include/inc_passcheck_internchk.php');
//var_dump($pass);
//var_dump($userid);
if ($pass=='check') {
    include($root_path.'include/inc_passcheck.php');
 }

require($root_path.'include/inc_passcheck_head.php');

require($root_path.'include/inc_passcheck_mask.php');


?>
